using System.Text;
using ChordCreator.Services.ConfigurationServices;

namespace ChordCreator.Model
{
    internal class ChordBase<T>
    {
        protected readonly T[] notes_;

        public T[] Notes
        {
            get {return notes_;}
        }
        public ChordBase(T[] notes)
        {
            notes_ = notes;
        }
        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();
            foreach (T note in notes_)
            {
                if (note is Note)
                {
                    builder.Append(CurrentConfiguration.Instance.GetNotePresentation((Note)(object)note));
                } else
                {
                    builder.Append(note);
                }
            }
            return builder.ToString();
        }
    }
}